import http from '@/utils/request.js'
import API from '@/config/api.config'

const authService = {
  //使用用户名密码登录
  login: (username, password) => http.request({
    url: API.login.usernameLogin,
    method: 'POST',
    data: { username, password }
  }),
  //发送短信验证码
  sendSms: (phone_number) => http.request({
    url: API.login.smsSend,
    method: 'POST',
    data: { phone_number } 
  }),
  //使用验证码登录
  smsLogin: (phone_number, verification_code) => http.request({
    url: API.login.smsLogin,
    method: 'POST',
    data: { phone_number, verification_code } 
  })
}
export default authService